package easy;
/*
168. Excel表列名称
 */
public class LeeCode168 {

  public static void main(String[] args) {
    System.out.println(new LeeCode168().convertToTitle(30));
  }

  public String convertToTitle(int columnNumber) {
    StringBuilder builder = new StringBuilder();
    while (columnNumber != 0){
      columnNumber--;
      builder.append((char)(columnNumber % 26 + 'A'));
      columnNumber = columnNumber/26;
    }
    return builder.reverse().toString();
  }
}
